- Tutorial 1 (The Hello Bob
Script)
- From the status window of NexIRC,
type:
DeclareVariable(lName); Then hit enter. Asuming
your typed it correctly, NexIRC should add the following text to the
Status window ':. Script Command [DeclareVariable(lName);]', You just declared
a variable. Variables are usefull if you wish to hold a number or words in
memory until NexIRC is closed or you type ?clear from the status window. If
your scripting syntax was incorrect, NexIRC will say something like ':.
Unknown Command'.
- Type:
SetVariableData(lName::$input::Enter
Your Name::NexIRC::Bob);
Then hit enter.You should be prompted with the $input command for
you to enter your name, hit enter to use Bob.
- Then Type: MsgBox(Hello ReturnVariable[lName]);
Then hit enter.If everything was done proporly, you should have
seen a MsgBox which says 'Hello Bob'.
- Now that you are done using the 'lName'
variable, you should probably clear it from memory. Type
ClearVariable(lName);Then Hit Enter.
- Now that you have created your first script, you
should probably view it to make sure it is typed correctly.Type
?view,then hit enter.The ?view command is good when you are writting
small code fragments.
- If the script looks good, you should learn
how to save it. Type: ?save, then hit enter.
- NexIRC will ask you for a filename, do not enter a
full path, just a filename. For example, you could
type 'hellobob.nirc' or 'mytestscripts\hellobob.nirc', however for now,
typehellobob.nirc,Then hit enter.Your script should be in
<nexircdir>\data\scripts\hellobob.nirc.
- Right click the
status window, and click
'Window/Menu Editor'.
- In the 'menus'
listbox (on the bottom right), you should see a menu called
'ROOT' click that.
- Where it says 'Caption' typeHello
Bob
, where it says 'Command' type
RunScriptFile(hellobob.nirc);
- Click
'Add' on the right
hand side above the 'sub menus' listbox.
- Now right click
on your status window, and you should see an entry at the bottom called '
Hello Bob', click it.
It should prompt you with a
Msgbox that says "Script: Hello Bob".
- After you have completed this script, you should
probably clear it from your status window. Type ?clear then hit
enter.